<?php echo $this->Html->script(array('actions','users.index'),$options = array('allowCache'=>false,'safe'=>false,'inline'=>false));?>
<?php echo $this->Html->css(array('users.index','form','actions'),null,array('inline'=>false));?>

<div class="users index box corners">

	<div id="tabs">
		<ul>	
			<li><a href="#tabs-users">Users</a></li>
			<li><a href="#tabs-providers">Managers</a></li>
		</ul>
		<div id="tabs-users">
			<h2><?php __('Users');?></h2>
			<table cellpadding="0" cellspacing="0" class="index">
				<tr>
					<th><?php echo __('No',true);?></th>
					<th><?php echo __('Email',true);?></th>
					<th><?php echo __('Status',true);?></th>
					<th><?php echo __('First Name',true);?></th>
					<th><?php echo __('Last Name',true);?></th>
					<th class="actions t-right"><?php echo $this->Html->link(__('New User', true), array('action' => 'add_user'),array('class'=>'add_user')); ?></th>
				</tr>
				<?php
				$i = 0;
				foreach ($users as $user):
					$class = null;
					if ($i++ % 2 == 0) {
						$class = ' class="altrow"';
					}
				?>
				<tr<?php echo $class;?>>
					<td><?php echo $user['User']['id']; ?>&nbsp;</td>
					<td><?php echo $user['User']['email']; ?>&nbsp;</td>
					<td><?php echo $user['User']['status']; ?>&nbsp;</td>
					<td><?php echo $user['User']['first_name']; ?>&nbsp;</td>
					<td><?php echo $user['User']['last_name']; ?>&nbsp;</td>
					<td class="actions">
						<?php echo $this->Html->link(__('View', true), array('action' => 'view', $user['User']['id']),array('class'=>'view')); ?>
						<?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $user['User']['id']),array('class'=>'delete'), sprintf(__('Are you sure you want to delete # %s?', true), $user['User']['id'])); ?>
					</td>
				</tr>
				<?php endforeach; ?>
			</table>
		</div>
		
		<div id="tabs-providers">
			<h2><?php __('Providers');?></h2>
			<table cellpadding="0" cellspacing="0" class="index">
				<tr>
					<th><?php echo __('No',true);?></th>
					<th><?php echo __('Email',true);?></th>
					<th><?php echo __('Status',true);?></th>
					<th><?php echo __('First Name',true);?></th>
					<th><?php echo __('Last Name',true);?></th>
					<th class="actions t-right"><?php echo $this->Html->link(__('New User', true), array('action' => 'add_provider'),array('class'=>'add_provider')); ?></th>
				</tr>
				<?php
				$i = 0;
				foreach ($providers as $user):
					$class = null;
					if ($i++ % 2 == 0) {
						$class = ' class="altrow"';
					}
				?>
				<tr<?php echo $class;?>>
					<td><?php echo $user['User']['id']; ?>&nbsp;</td>
					<td><?php echo $user['User']['email']; ?>&nbsp;</td>
					<td><?php echo $user['User']['status']; ?>&nbsp;</td>
					<td><?php echo $user['User']['first_name']; ?>&nbsp;</td>
					<td><?php echo $user['User']['last_name']; ?>&nbsp;</td>
					<td class="actions">
						<?php echo $this->Html->link(__('View', true), array('controller'=>'provider','action' => 'index', $user['User']['id']),array('class'=>'view')); ?>
						<?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $user['User']['id']),array('class'=>'delete'), sprintf(__('Are you sure you want to delete # %s?', true), $user['User']['id'])); ?>
					</td>
				</tr>
				<?php endforeach; ?>
			</table>

		</div>
	</div>
<div class="actions main_actions">
	<h3><?php __('Actions'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('Dodaj użytkownika', true), array('action' => 'add_user'),array('class'=>'add_user')); ?> </li>
	</ul>
</div>